//
// Created by LiuYou on 2021/5/6.
//

#include <fcntl.h>
#include "ClientData.hpp"

int Client::setNonBlocking(int fd) {
    int oldOption = fcntl(fd, F_GETFL);
    int newOption = oldOption | O_NONBLOCK;
    fcntl(fd, F_SETFL, newOption);
    return oldOption;
}
